<?php
        define("GRID_SOURCE", "");
        include(GRID_SOURCE."class/gridclasses.php"); //Include the grid engine.

        session_start();
		require_once "../funciones.php";
		$link_caweb = con_caweb();	
        $grid_id = array("grid");
        unset($_SESSION["grid"]);
        include(GRID_SOURCE."class/gridcreate.php"); //Creates grid objects.
        
        $transaccion=$_SESSION['caweb']['consecutivo'];
        
?>
<html>
        <head>
            <title>Cambios</title>
            <script language="Javascript" type="text/javascript" src="<?php print(GRID_SOURCE);?>javascript/javascript.js"></script>
            <link href="<?php print(GRID_SOURCE);?>css/style.css" rel="stylesheet" type="text/css" />
			<script type='text/javascript' src="<?php print(GRID_SOURCE);?>server.php?client=all"></script>
			<script>
			HTML_AJAX.defaultServerUrl = '<?php print(GRID_SOURCE);?>server.php';
			</script>
            <script type="text/javascript" src="jquery.js"></script>
            <script>
            function validar(e,serial)
                {
                    var tecla;
                	
                    if (document.all) { tecla = e.keyCode;  } 
                    else {  tecla = e.which; }
                    if (tecla == 13) { location.href="adiciona_cam.php?serial="+serial;  }
                    else { return false; }
                }
            </script>
        </head>

        <body onload="document.getElementById('Editbox1').focus();">

<?php

		$result ="SELECT * FROM temporal_ped WHERE transaccion = '$transaccion'";
		$result=mysql_query($result,$link_caweb) or die('Error temporal_ped, '.mysql_error());
		$totalpresuntos=mysql_num_rows($result);
        echo "<script languaje='Javascript'>  $('#presuntos', top.document).attr('value','".$totalpresuntos."'); </script>";

		if ($_SESSION['caweb']['iniciar'] == 1)
		{
			?>
			Interno :<input type="text" id="Editbox1" onkeypress="validar(event,this.value);" size="15" name="Editbox1" value="" />

			<?php
			echo  "Ultimo Mensaje: ".$_SESSION['caweb']['ultimoitem'];
			if ($_SESSION['caweb']['resultado'] == 0) { echo "<font color=red><b> INTERNO NO existe o no es de la Clase C.I.M.O</b></font>"; }
            if ($_SESSION['caweb']['resultado'] == 1) { echo "<font color=green><b> CORRECTO </b></font>"; }
            if ($_SESSION['caweb']['resultado'] == 2) { echo "<font color=red><b> INTERNO NO esta en ESTE cliente </b></font>"; }
            if ($_SESSION['caweb']['resultado'] == 3) { echo "<font color=red><b> INTERNO YA ESTA en transaccion $transaccion </b></font>"; }
            if ($_SESSION['caweb']['resultado'] == 4) { echo "<font color=red><b> INTERNO NO ESTA SIENDO FACTURADO (ver con contabilidad) </b></font>"; }
            if ($_SESSION['caweb']['resultado'] == 5) { echo "<font color=red><b> INTERNO es PRESUNTO en Otro ambio sin Concluir </b></font>"; }
   			if ($_SESSION['caweb']['resultado'] == 6) { echo "<font color=red><b> No se ADMITEN MAS internos en un PT </b></font>"; }
   			if ($_SESSION['caweb']['resultado'] == 9) { echo "<font color=green><b> SIN DATOS </b></font>"; }

			$consecutivo=$_SESSION['caweb']['consecutivo'];
			$condicion="transaccion='$consecutivo'";
   			$_SESSION["grid"]->SetDatabaseConnection($_SESSION['caweb']['basededatos'], "caweb", "caweb");

			$_SESSION["grid"]->SetSqlSelect('id,interno,clase,item,memoria,disco,video,red,optico,otro,software','temporal_ped',$condicion);
			$_SESSION["grid"]->SetUniqueDatabaseColumn("id", false);
			$_SESSION["grid"]->SetTitleName("(transaccion $consecutivo) Ingreso los PRESUNTOS VALIDOS para el Pt/Rt");
			$_SESSION["grid"]->SetEditModeEdit(true);
			$_SESSION["grid"]->SetMaxRowsEachPage(15);
   			$_SESSION["grid"]->SetDatabaseColumnEditable("id", false);
   			$_SESSION["grid"]->SetDatabaseColumnEditable("interno", false);
			$_SESSION["grid"]->SetDatabaseColumnEditable("clase", false);
   			$_SESSION["grid"]->SetDatabaseColumnEditable("item", false);
			$_SESSION["grid"]->SetDatabaseColumnEditable("memoria", true);
			$_SESSION["grid"]->SetDatabaseColumnEditable("disco", true);
			$_SESSION["grid"]->SetDatabaseColumnEditable("video", true);
			$_SESSION["grid"]->SetDatabaseColumnEditable("red", true);
			$_SESSION["grid"]->SetDatabaseColumnEditable("optico", true);
			$_SESSION["grid"]->SetDatabaseColumnEditable("otro", true);
			$_SESSION["grid"]->SetDatabaseColumnEditable("software", true);
			$_SESSION["grid"]->SetShowExcelIco(false);
			$_SESSION["grid"]->SetShowPrintIco(true);
			$_SESSION["grid"]->PrintGrid(MODE_EDIT);
	}
	?>
 </body> 
</html>